import {ClientOpinionVo, SysDictDataVo} from "@/service/api/system/feedback/types.ts";
import {PromisePageResponse, PromiseResponse} from "@/service/api/type.ts";
import request from "@/service/request.ts";

/**
 * 获取举报列表
 * @param query
 */
const getFeedbackList = (query: any): PromisePageResponse<ClientOpinionVo> => {
  return request({
    url: "/client/opinion/list",
    method: "get",
    params: query,
  });
};

/**
 * 获取问题类型
 * @param query
 */
const getQuestionTypeList = (query: any): PromisePageResponse<SysDictDataVo> => {
  return request({
    url: "/system/dict/data/list",
    method: "get",
    params: query,
  });
};

/**
 * 获取问题
 * @param id
 */
const getFeedbackDetail = (id: string): PromiseResponse<ClientOpinionVo> => {
  return request({
    url: `/client/opinion/${id}`,
    method: "get",
  });
};

export {
  getFeedbackList,
  getQuestionTypeList,
  getFeedbackDetail,
};
